{% extends "base/base.html" %}
{% load staticfiles %}
{% block style %}
    <script src="{% static 'js/matrix.login.js' %}"></script>
    <link rel="stylesheet" href="{% static 'css/black/matrix-login.css' %}"/>
{% endblock %}
{% block main %}
    {% load bootstrap3 %}
    <div id="loginbox">
        <form id="loginform" class="form-vertical" action="" method="post" onsubmit="return checkInputRequired(this)">
            {% csrf_token %}
{#            <div class="control-group normal_text"><img src="" alt="Logo" height="75px;"/>#}
{#            </div>#}
            {{ block.super }}
            <div class="control-group">
                <div class="input-group">
                    <div class="input-group-addon bg_lg"><i class="glyphicon glyphicon-user"></i></div>
                    <!--                    <input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount"> -->
                    <input type="text" title="用户名"
                           required="required" placeholder="用户名"
                           name="username" required="required" maxlength="15"
                           id="id_username" class="form-control" autocomplete="off">
                </div>
            </div>
            <div class="control-group">
                <div class="input-group">
                    <div class="input-group-addon bg_ly"><i class="glyphicon glyphicon-lock"></i></div>
                    <input type="password" title="登录密码"
                           placeholder="登录密码" name="password"
                           id="id_password" required="required" maxlength="15" class="form-control">
                </div>
            </div>
            <div class="control-group">
                <div class="input-group">
                    <span class="pull-left" style=""><input type="submit" class="btn btn-primary" value="登 录"/></span>
                </div>
            </div>
        </form>
    </div>
{% endblock %}
{% block footjs %}
    <script>
        function checkInputRequired(_this) {
            var flag = true;
            $(_this).find("input[required='required']").each(function () {
                if (!$(this).val()) {
                    flag = false;
                }
            }
// 	$("input[required='required']").each(function(){
// 		if(!$(this).val()){
// 		    flag = false;
// 		}
// 	}
            );
            return flag;
        }
    </script>
{% endblock %}